    @Override
    public ResponseDTO getMerInfoByLocation(double latitude, double longitude, String selectedAddress)  {
        //分割获取地址信息
        String[] addressArray = selectedAddress.split("市");
        String city = addressArray[0];
        //获取所有商家的经纬度信息以及商家id
        List<Merchant> merchantLocation = merchantMapper.getMerchantLocation(city);
        //遍历商家经纬度信息
        // 创建一个新的列表以避免并发修改问题
        List<Merchant> merchantListCopy = new ArrayList<>(merchantLocation);
        for (Merchant merLocalBean : merchantListCopy) {
            //使用高德api计算所有商家与用户的距离
            try {
                long distance = getDistance(latitude, longitude, merLocalBean.getAddressLatitude(), merLocalBean.getAddressLongitude());
                merLocalBean.setDistance(distance);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        //按照距离排序
        merchantListCopy.sort((o1, o2) -> (int) (o1.getDistance() - o2.getDistance()));
        return ResponseDTO.success(merchantListCopy);